﻿Public Class frmRegistrarRol

    Private Sub btnSiguiente_Click(sender As Object, e As EventArgs) Handles btnSiguiente.Click
        If txtNombre.Text = "" Then
            lblNombre.Visible = True
        End If
        If txtDescripcion.Text = "" Then
            lblNombreComun.Visible = True
        End If
        If txtNombre.Text <> "" And txtDescripcion.Text <> "" Then
            Dim entro As Boolean = False
            For Each x As Control In Me.Parent.Controls.OfType(Of frmAsociarPermisosARol)()

                x.Visible = True
                entro = True
            Next
            If Not entro Then
                Dim frm As New frmAsociarPermisosARol
                frm.Dock = DockStyle.Fill
                frmTransparente.AgregarContenido(frm)
                frmTransparente.Show()
            End If
            Me.Visible = False
        End If
    End Sub

    Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
        Me.Hide()
        frmTransparente.Close()
        frmSecundario.Close()
    End Sub

    Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
        Dim frmcancelar As New frmCancelar 'crea una instancia del form modificar roles
        frmcancelar.Dock = DockStyle.Fill
        frmTransparente.AgregarContenido(frmcancelar)
        frmcancelar.agregarLabels("del registro del rol?", "registro", frmcancelar)
        frmTransparente.Show()
        Me.Hide()
        frmSecundario.Width = Screen.PrimaryScreen.WorkingArea.Width
        frmSecundario.Height = Screen.PrimaryScreen.WorkingArea.Height - Screen.PrimaryScreen.WorkingArea.Height * (60 / 100)
        frmSecundario.Location = New Point(Screen.PrimaryScreen.WorkingArea.X, Screen.PrimaryScreen.WorkingArea.Height * (32 / 100))
    End Sub


End Class
